<template>
  <div class="admin-layout">
    <aside class="sidebar">
      <h1 class="logo">后台</h1>
      <nav class="menu">
        <router-link to="/dashboard" class="menu-item">首页</router-link>
        <router-link to="/attractions" class="menu-item">景点管理</router-link>
        <router-link to="/foods" class="menu-item">美食管理</router-link>
        <router-link to="/routes" class="menu-item">线路管理</router-link>
        <router-link to="/activities" class="menu-item">文化活动管理</router-link>
        <router-link to="/accommodations" class="menu-item">住宿管理</router-link>
        <router-link to="/faqs" class="menu-item">FAQ管理</router-link>
        <router-link to="/images" class="menu-item">图片管理</router-link>
        <router-link to="/contact" class="menu-item">咨询管理</router-link>
      </nav>
    </aside>
    <main class="main-content">
      <header class="main-header">
        <h2>欢迎来到旅游后台管理系统</h2>
      </header>
      <div class="content-area">
        <router-view></router-view>
      </div>
    </main>
  </div>
</template>

<script setup lang="ts">
import { RouterView, RouterLink } from 'vue-router';
</script>

<style scoped>
.admin-layout {
  display: flex;
  width: 100vw;
  height: 100vh;
  background-color: #f4f6f9;
  margin: 0;
  padding: 0;
}

.sidebar {
  width: 240px;
  background-color: #2c3e50;
  color: #ecf0f1;
  display: flex;
  flex-direction: column;
  padding: 20px 0;
  box-shadow: 2px 0 5px rgba(0,0,0,0.1);
  margin: 0;
}

.logo {
  font-size: 24px;
  font-weight: bold;
  text-align: center;
  padding-bottom: 20px;
  margin: 0 0 20px 0;
  border-bottom: 1px solid #34495e;
}

.menu {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
}

.menu-item {
  padding: 15px 20px;
  color: #ecf0f1;
  text-decoration: none;
  transition: background-color 0.3s, color 0.3s;
  border-left: 3px solid transparent;
  margin: 0;
}

.menu-item:hover,
.menu-item.router-link-exact-active {
  background-color: #34495e;
  color: #ffffff;
  border-left-color: #3498db;
}

.main-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  margin: 0;
  padding: 0;
}

.main-header {
  padding: 20px;
  background-color: #ffffff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  border-bottom: 1px solid #e0e0e0;
  margin: 0;
}

.main-header h2 {
  color: #2c3e50;
  margin: 0;
  padding: 0;
}

.content-area {
  padding: 20px;
  flex-grow: 1;
  margin: 0;
}
</style> 